package cn.simon.free.validator.annotation;

import cn.simon.free.validator.core.MobileValidator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * 手机号校验
 *
 * @author simon
 * @date 2020/6/5 11:45
 * @copyright:
 * @modifier
 * @motto a no talent, people who have to study hard
 */
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = MobileValidator.class)
public @interface MobileValid {

    /**
     * 是否启用
     *
     * @return
     */
    boolean required() default true;

    /**
     * 返回的异常信息
     *
     * @return
     */
    String message() default "";

    /**
     * 组
     *
     * @return
     */
    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}
